#pragma once
template<class T>
class singleton
{
public:
	static T* getInstance()
	{
		if( !_instance )
		{
			_instance = new T;
		}
		return _instance;
	}
protected:
	singleton(){}
	virtual ~singleton(){}
	singleton(const singleton&){}
	static T* _instance;
};

template <class T>
T* singleton<T>::_instance;
